package juc;

import lombok.extern.slf4j.Slf4j;

import static juc.Sleeper.sleep;

//模拟统筹——洗水壶、烧水、洗茶壶、洗茶杯、拿茶叶
//一个线程洗水壶+烧水  15min
//一个线程 洗茶壶、洗茶杯、拿茶叶    4min
@Slf4j(topic = "c.Test02")
public class Test02 {
    public static void main(String[] args) {

        Thread t1 = new Thread(()->{
           log.debug("洗水壶");
           sleep(1);
           log.debug("烧水");
           sleep(15);
           log.debug("t1结束");
        },"t1");

        Thread t2 = new Thread(() -> {
           log.debug("洗茶壶");
           sleep(1);
           log.debug("洗茶杯");
           sleep(2);
           log.debug("拿茶叶");
           sleep(1);
            log.debug("t2结束");
        },"t2");

        t1.start();
        t2.start();
    }
}
